<template>
  <div class="form-inline form-filter">
    <div class="form-group form-group-sm">
      分类：<select class="form-control" v-model="filter.mainCategoryId">
              <option value="-1">全部</option>
              <option value="{{it.id}}" v-for="it in mainCategory">{{it.name}}</option>
            </select>
    </div>
    <div class="form-group form-group-sm">
      行业：<select class="form-control" v-model="filter.industryCategoryId">
              <option value="-1">全部</option>
              <option value="{{it.id}}" v-for="it in industryCategory">{{it.name}}</option>
            </select>
    </div>
    <br>
    <div class="form-group form-group-sm">
      姓名：<input type="text" class="form-control" v-model="filter.name">
    </div>
    <div class="form-group form-group-sm">
      电话：<input type="text" class="form-control" v-model="filter.phone">
    </div>
    <div class="form-group form-group-sm">
      邮箱：<input type="text" class="form-control" v-model="filter.email">
    </div>
    <br>
    <div class="form-group form-group-sm">
      公司：<input type="text" class="form-control" v-model="filter.company">
    </div>
    <div class="form-group form-group-sm">
      工作经历关键字：<input type="text" class="form-control" v-model="filter.experience">
    </div>
    <br>
    <button class="btn btn-sm btn-info" @click="clearFilterForm">清空条件</button>
    <button class="btn btn-sm btn-primary" @click="searchExpert">筛选</button>
    <button class="btn btn-sm btn-primary" @click="exportExpert" v-if="+exportPrivilege === 1">导出</button>
  </div>
  <table v-show="list && list.length > 0" class="table table-bordered table-hover">
    <caption>专家库</caption>
    <thead>
      <tr>
        <th>姓名</th>
        <th>电话</th>
        <th>邮箱</th>
        <th>分类</th>
        <th>行业</th>
        <th>公司</th>
        <th>职位</th>
        <th>工作经历</th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="it in list">
        <td>{{it.name}}
        <td>{{it.phone}}</td>
        <td>{{it.email}}</td>
        <td>{{it.mainCategory}}</td>
        <td>{{it.industryCategory}}</td>
        <td>{{it.company}}</td>
        <td>{{it.position}}</td>
        <td>{{it.experience}}</td>
        <td class="col-nowrap text-right">
          <a :href=" 'detail.html?id=' + it.id " class="btn btn-sm btn-primary">详情</a>
          <button class="btn btn-sm btn-danger" @click="deleteItem(it.id)">删除</button>
        </td>
      </tr>
    </tbody>
  </table>
  <vue-pages :pages.sync="pages" :get-list="getList"></vue-pages>
</template>
<style src="./expert-list.css" scoped></style>
<script src="./expert-list.js"></script>